<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let math = Math.ceil(Math.random() * 10)
        console.log(math);
        let i
        let j = 0
        while (i != math) {
            i = prompt("输入")
            if (i == math) {
                alert('对了')
                break
            } else if (i > math) {
                alert('大了')
            } else {
                alert('小了')
            }
            j++
            if (j > 2) {
                alert("sanci")
                break
            }
        }
    </script>
</body>

</html>